package com.test.netty.protocol;

import com.test.netty.consumer.NettyClient;
import com.test.netty.entity.Invocation;
import com.test.netty.entity.URL;
import com.test.netty.provider.NettyServer;

public class DubboProtocol implements Protocol{

    @Override
    public void start(URL url) {
        NettyServer server = new NettyServer();
        server.start(url.getHost(), url.getPort());
    }

    @Override
    public String send(URL url, Invocation invocation) {
        NettyClient client = new NettyClient();
        return client.send(url.getHost(), url.getPort(), invocation);
    }
}
